package com.bumblebee.server.model;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

/**
 * 
 * @author Dinesh
 *
 */
@Entity
public class Customer extends AbstractEntity{

	@Column(nullable = false)
	private String name;
	
	private Date dob;
	
	@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
	@JoinColumn(name = "customer_id")
	private Set<Address> addresses = new HashSet<Address>();
	
	@OneToOne
	private CommunicationDetails contactDetails;
	
	@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
	@JoinColumn(name = "customer_id")
	private Set<HouseHold> houseHold = new HashSet<HouseHold>();
	
	private Double pointsEarned;

	@Column(nullable = false)
	private Gender gender;
	
	public Gender getGender() {
		return gender;
	}

	public void setGender(Gender gender) {
		this.gender = gender;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getDob() {
		return dob;
	}

	public void setDob(Date dob) {
		this.dob = dob;
	}

	public CommunicationDetails getContactDetails() {
		return contactDetails;
	}

	public void setContactDetails(CommunicationDetails contactDetails) {
		this.contactDetails = contactDetails;
	}

	public Set<HouseHold> getHouseHold() {
		return houseHold;
	}

	public void setHouseHold(Set<HouseHold> houseHold) {
		this.houseHold = houseHold;
	}

	public Double getPointsEarned() {
		return pointsEarned;
	}

	public void setPointsEarned(Double pointsEarned) {
		this.pointsEarned = pointsEarned;
	}

	public Set<Address> getAddresses() {
		return addresses;
	}

	public void setAddresses(Set<Address> addresses) {
		this.addresses = addresses;
	}
	
}
